package com.yb.xczx.cloud.auth.controller;


import com.yb.xczx.cloud.auth.oauth2.repository.XczxRegisteredClientRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 姚兵
 * @since 2023-05-17
 */
@RestController
@RequestMapping("/client/register")
public class Oauth2RegisteredClientController {
    @Autowired
    XczxRegisteredClientRepository registeredClientRepository;


    @GetMapping("/findById")
    public RegisteredClient findById(String id){
        return registeredClientRepository.findById(id);
    }

    @GetMapping("/findByClientId")
    public RegisteredClient findByClientId(String clientId){
        return registeredClientRepository.findByClientId(clientId);
    }

}
